package com.example.mytransitiondemo.MaterialDesign;

import android.animation.Animator;

import android.os.Bundle;
import android.view.View;
import android.view.ViewAnimationUtils;

import android.widget.ImageView;

import com.example.mytransitiondemo.BaseActivity;
import com.example.mytransitiondemo.R;


public class MaterialDesignActivity extends BaseActivity implements View.OnClickListener {

    private ImageView show_pic;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_material_design);


        show_pic = (ImageView) findViewById(R.id.show_pic);  //
        findViewById(R.id.reveal).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.reveal:
                //直径
                int d = Math.max(show_pic.getHeight(), show_pic.getWidth()) * 2;
                Animator animator = ViewAnimationUtils.createCircularReveal(show_pic, 0, 0, 0, d);
                animator.setDuration(1000);
                animator.start();
                break;
        }
    }
}
